
This resource address can be used to create and load CPF pipelines for the specified database. For details on creating pipelines, see Create the Pipeline.
| URL Parameters | |
|---|---|
| format | The format of the posted data. Can be either
html, json, or xml (default). This value overrides
the Accept header if both are present. |
Upon success, MarkLogic Server returns status code 201 (Created). If the pipeline already exists or if the payload is malformed, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.
manage-admin role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage-admin
Use the following operation to load the pipelines. This operation loads the pipelines from
the /opt/MarkLogic/Installer directory. Reapplying this operation will
effectively reinstall cpf pipelines from the current MarkLogic distribution, which is needed
to upgrade pipelines.
{
"operation": "load-default-cpf-pipelines"
}
The structure of the data in the request body to create a new pipeline is as follows.
For details about the purpose of each element and its possible values, see
XML Format of a Pipeline. annotationpipeline-idpipeline-namepipeline-descriptionsuccess-actionfailure-actionstatus-transitionThis is a complex structure with the following children:
annotationstatuson-successon-failurepriorityalwaysdefault-actionexecuteThis is a complex structure with the following children:
annotationconditionactionstate-transitionThis is a complex structure with the following children:
annotationstateon-successon-failurepriorityalwaysdefault-actionexecuteThis is a complex structure with the following children:
annotationconditionactionevent-transitionThis is a complex structure with the following children:
annotationeventprioritydefault-actionexecuteThis is a complex structure with the following children:
annotationconditionaction
cat pipeline.json
==>
{
"pipeline-name": "Status Change Handling",
"pipeline-description": "Out-of-the-box document status handling.",
"success-action": {
"module": "/MarkLogic/cpf/actions/success-action.xqy"
},
"failure-action": {
"module": "/marklogic/cpf/actions/failure-action.xqy"
},
"status-transition": [
{
"annotation": "",
"status": "created",
"on-success": "http://marklogic.com/states/initial",
"priority": 100,
"default-action": {
"module": "/marklogic/cpf/actions/set-updated-action.xqy"
},
"execute": [
{
"condition": {
"module": "/marklogic/cpf/actions/changed-type-condition.xqy"
},
"action": {
"module": "/marklogic/cpf/actions/success-action.xqy"
}
},
{
"condition": {
"module": "/MarkLogic/cpf/actions/renamed-links-condition.xqy"
},
"action": {
"module": "/MarkLogic/cpf/actions/link-rename-action.xqy"
}
},
{
"condition": {
"module": "/MarkLogic/cpf/actions/existing-state-condition.xqy"
},
"action": {
"module": "/MarkLogic/cpf/actions/touch-state-action.xqy"
}
}
]
}
]
}
curl -X POST --anyauth --user admin:admin \
--header "Content-Type:application/json" -d@pipeline.json \
http://localhost:8002/manage/v2/databases/Triggers/pipelines?format=json
==> Creates a new pipeline, named "Status Change Handling," in the Triggers
database.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.